package com.wlc.service.impl;

import com.wlc.mapper.DeptStatsMapper;
import com.wlc.service.DeptStatsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
@Slf4j
public class DeptStatsServiceImpl implements DeptStatsService {

    @Autowired
    private DeptStatsMapper deptStatsMapper;

    @Override
    public List<Map<String, Object>> getDeptEmployeeStats() {
        log.info("查询部门人数统计");
        return deptStatsMapper.selectDeptEmployeeStats();
    }

    @Override
    public List<Map<String, Object>> getDeptGenderStats(Long deptId) {
        log.info("查询部门性别分布: deptId={}", deptId);
        return deptStatsMapper.selectDeptGenderStats(deptId);
    }
}